package along.com.myboxugu.activity;

import android.content.pm.ActivityInfo;
import android.net.Uri;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.WindowManager;
import android.widget.MediaController;
import android.widget.VideoView;

import along.com.myboxugu.R;

public class VideoActivity extends AppCompatActivity {
VideoView mVideoView;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_video);
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
                WindowManager.LayoutParams.FLAG_FULLSCREEN);
        setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);//页面全屏和横屏
        String viderourl= getIntent().getStringExtra("video");
        mVideoView = (VideoView) findViewById(R.id.videoTTT);
        mVideoView.setVideoURI(Uri.parse(viderourl));//设置播放控制器
        MediaController controller =new MediaController(this);
        mVideoView.setMediaController(controller);
        mVideoView.start();
    }
}
